<cfcomponent name="AgenciesService" output="false">

	<cffunction name="init" access="public" output="false" returntype="AgenciesService">
		<cfargument name="AgenciesDAO" type="AgenciesDAO" required="true" />
		<cfargument name="AgenciesGateway" type="AgenciesGateway" required="true" />

		<cfset variables.AgenciesDAO = arguments.AgenciesDAO />
		<cfset variables.AgenciesGateway = arguments.AgenciesGateway />

		<cfreturn this/>
	</cffunction>

	<cffunction name="createAgencies" access="public" output="false" returntype="Agencies">
		<cfargument name="id" type="numeric" required="true" />
		<cfargument name="name" type="string" required="false" />
		<cfargument name="address1" type="string" required="false" />
		<cfargument name="address2" type="string" required="false" />
		<cfargument name="city" type="string" required="false" />
		<cfargument name="state" type="string" required="false" />
		<cfargument name="zipCode" type="string" required="false" />
		<cfargument name="location" type="string" required="false" />
		<cfargument name="phone" type="string" required="false" />
		<cfargument name="fax" type="string" required="false" />
		<cfargument name="website" type="string" required="false" />
		<cfargument name="acceptUGJunior" type="numeric" required="false" />
		<cfargument name="acceptUGSenior" type="numeric" required="false" />
		<cfargument name="acceptFirstYear" type="numeric" required="false" />
		<cfargument name="acceptSecondYear" type="numeric" required="false" />
		<cfargument name="totalStudents" type="string" required="false" />
		<cfargument name="agencyPractice" type="string" required="false" />
		<cfargument name="servicesProvided" type="string" required="false" />
		<cfargument name="theoryBase" type="string" required="false" />
		<cfargument name="macroArea" type="string" required="false" />
		<cfargument name="clinicalArea" type="string" required="false" />
		<cfargument name="other" type="string" required="false" />
		<cfargument name="stipend" type="string" required="false" />
		<cfargument name="forProfit" type="boolean" required="false" />
		<cfargument name="clinical" type="boolean" required="false" />
		<cfargument name="foundation" type="boolean" required="false" />
		<cfargument name="macro" type="boolean" required="false" />
		<cfargument name="combined" type="boolean" required="false" />
		<cfargument name="health" type="boolean" required="false" />
		<cfargument name="metro" type="boolean" required="false" />
		<cfargument name="carLicense" type="boolean" required="false" />
		<cfargument name="foriegnLanguage" type="boolean" required="false" />
		<cfargument name="flexTime" type="boolean" required="false" />
		<cfargument name="handicapAccessible" type="boolean" required="false" />
		<cfargument name="faithBased" type="boolean" required="false" />
		<cfargument name="affiliationAgreement" type="boolean" required="false" />
		<cfargument name="fwsAgreement" type="boolean" required="false" />
		<cfargument name="agencyProfile" type="boolean" required="false" />
		<cfargument name="multipleSites" type="boolean" required="false" />
		<cfargument name="dateNinetyNine" type="date" required="false" />
		<cfargument name="datePhoneInformationReceived" type="date" required="false" />
		<cfargument name="dateOfAffiliation" type="date" required="false" />
		<cfargument name="dateOfVisit" type="date" required="false" />
		<cfargument name="backgroundDrugScreening" type="boolean" required="false" />
		<cfargument name="backgroundChildAbuse" type="boolean" required="false" />
		<cfargument name="backgroundImmunizationVerification" type="boolean" required="false" />
		<cfargument name="backgroundLiabilityVerification" type="boolean" required="false" />
		<cfargument name="backgroundSpecialApplication" type="boolean" required="false" />
		<cfargument name="backgroundReferenceLetters" type="boolean" required="false" />
		<cfargument name="backgroundFingerprinting" type="boolean" required="false" />
		<cfargument name="backgroundPoliceClearance" type="boolean" required="false" />
		<cfargument name="backgroundTBScreen" type="boolean" required="false" />
		<cfargument name="backgroundOther" type="string" required="false" />
		<cfargument name="backgroundRequiredDays" type="string" required="false" />
		<cfargument name="ageGroupAdults" type="boolean" required="false" />
		<cfargument name="ageGroupOlderAdults" type="boolean" required="false" />
		<cfargument name="ageGroupAdolescents" type="boolean" required="false" />
		<cfargument name="ageGroupFamilies" type="boolean" required="false" />
		<cfargument name="ageGroupChildren0to5" type="boolean" required="false" />
		<cfargument name="ageGroupChildren6to12" type="boolean" required="false" />
		<cfargument name="comments" type="string" required="false" />
		<cfargument name="needsLongForm" type="boolean" required="false" />
		<cfargument name="currentlyActive" type="boolean" required="false" />
		<cfargument name="doNotUse" type="boolean" required="false" />
		<cfargument name="agencyFlag" type="boolean" required="false" />
		<cfargument name="typeOfSetting" type="string" required="false" />
		<cfargument name="privateComments" type="string" required="false" />
		<cfargument name="leAdministration" type="numeric" required="false" />
		<cfargument name="leAdvocacy" type="numeric" required="false" />
		<cfargument name="leCaseManagement" type="numeric" required="false" />
		<cfargument name="leClinicalCaseManagement" type="numeric" required="false" />
		<cfargument name="leCommOrganization" type="numeric" required="false" />
		<cfargument name="leCrisisIntervention" type="numeric" required="false" />
		<cfargument name="leDischargePlanning" type="numeric" required="false" />
		<cfargument name="leFamilyTreatment" type="numeric" required="false" />
		<cfargument name="leGroupTreatment" type="numeric" required="false" />
		<cfargument name="leIndWithAdult" type="numeric" required="false" />
		<cfargument name="leIndWithChildren" type="numeric" required="false" />
		<cfargument name="leIndWithAdolescents" type="numeric" required="false" />
		<cfargument name="lePolicyAnalysis" type="numeric" required="false" />
		<cfargument name="leProgramPlanning" type="numeric" required="false" />
		<cfargument name="leProgramManagement" type="numeric" required="false" />
		<cfargument name="leResearch" type="numeric" required="false" />
		<cfargument name="leOther1" type="string" required="false" />
		<cfargument name="leOther2" type="string" required="false" />
		<cfargument name="tbCogBehavioral" type="boolean" required="false" />
		<cfargument name="tbCommTheory" type="boolean" required="false" />
		<cfargument name="tbCommDevelopment" type="boolean" required="false" />
		<cfargument name="tbContingency" type="boolean" required="false" />
		<cfargument name="tbCrisis" type="boolean" required="false" />
		<cfargument name="tbEcological" type="boolean" required="false" />
		<cfargument name="tbEmpowerment" type="boolean" required="false" />
		<cfargument name="tbExchange" type="boolean" required="false" />
		<cfargument name="tbFamilyTherapy" type="boolean" required="false" />
		<cfargument name="tbFeminist" type="boolean" required="false" />
		<cfargument name="tbPowerDependence" type="boolean" required="false" />
		<cfargument name="tbPsychodynamic" type="boolean" required="false" />
		<cfargument name="tbPsychosocial" type="boolean" required="false" />
		<cfargument name="tbSolution" type="boolean" required="false" />
		<cfargument name="tbSystems" type="boolean" required="false" />
		<cfargument name="tbTranspersonal" type="boolean" required="false" />
		<cfargument name="lobbying" type="boolean" required="false" />
		<cfargument name="nonProfit" type="boolean" required="false" />
		<cfargument name="agencyPublic" type="boolean" required="false" />
		<cfargument name="agencyPrivate" type="boolean" required="false" />
		<cfargument name="federal" type="boolean" required="false" />
		<cfargument name="stateCounty" type="boolean" required="false" />
		<cfargument name="communityBased" type="boolean" required="false" />
		<cfargument name="undergraduateJunior" type="boolean" required="false" />
		<cfargument name="ataother" type="string" required="false" />
		<cfargument name="adultsRank" type="numeric" required="false" />
		<cfargument name="olderAdultsRank" type="numeric" required="false" />
		<cfargument name="adolescentsRank" type="numeric" required="false" />
		<cfargument name="familiesRank" type="numeric" required="false" />
		<cfargument name="children0to5Rank" type="numeric" required="false" />
		<cfargument name="children6to12Rank" type="numeric" required="false" />
		<cfargument name="multiple" type="string" required="false" />
		<cfargument name="isPrivate" type="boolean" required="false" />
		<cfargument name="isPublic" type="boolean" required="false" />
		<cfargument name="completedDate" type="date" required="false" />
		<cfargument name="completedName" type="string" required="false" />
		<cfargument name="completedEmail" type="string" required="false" />
		<cfargument name="undergraduateSenior" type="boolean" required="false" />
		<cfargument name="transport" type="boolean" required="false" />
		<cfargument name="backgroundMedicalExam" type="boolean" required="false" />
		<cfargument name="tHomeVisits" type="boolean" required="false" />
		<cfargument name="tDriversLicense" type="boolean" required="false" />
		<cfargument name="tAutomobile" type="boolean" required="false" />
		<cfargument name="tAgencyVehicle" type="boolean" required="false" />
		<cfargument name="tOwnVehicle" type="boolean" required="false" />
		<cfargument name="tCovered" type="boolean" required="false" />
		<cfargument name="tOther" type="string" required="false" />
		<cfargument name="mpPolicyAnalysis" type="numeric" required="false" />
		<cfargument name="mpAdvocacy" type="numeric" required="false" />
		<cfargument name="mpCommOrganization" type="numeric" required="false" />
		<cfargument name="mpManagement" type="numeric" required="false" />
		<cfargument name="mpAdministration" type="numeric" required="false" />
		<cfargument name="mpPlanning" type="numeric" required="false" />
		<cfargument name="mpEvalResearch" type="numeric" required="false" />
		<cfargument name="comments2" type="string" required="false" />
		<cfargument name="notSureYet" type="boolean" required="false" />
		<cfargument name="flexHours" type="string" required="false" />
		<cfargument name="leIndWithAdultAdd" type="string" required="false" />
		<cfargument name="leIndWithChildrenAdd" type="string" required="false" />
		<cfargument name="leIndWithAdolescentsAdd" type="string" required="false" />
		<cfargument name="foreignLanguagePreferred" type="boolean" required="false" />
		
			
		<cfset var Agencies = createObject("component","Agencies").init(argumentCollection=arguments) />
		<cfreturn Agencies />
	</cffunction>

	<cffunction name="getAgencies" access="public" output="false" returntype="Agencies">
		<cfargument name="id" type="numeric" required="true" />
		
		<cfset var Agencies = createAgencies(argumentCollection=arguments) />
		<cfset variables.AgenciesDAO.read(Agencies) />
		<cfreturn Agencies />
	</cffunction>

	<cffunction name="getAgenciess" access="public" output="false" returntype="array">
		<cfargument name="id" type="numeric" required="false" />
		<cfargument name="name" type="string" required="false" />
		<cfargument name="address1" type="string" required="false" />
		<cfargument name="address2" type="string" required="false" />
		<cfargument name="city" type="string" required="false" />
		<cfargument name="state" type="string" required="false" />
		<cfargument name="zipCode" type="string" required="false" />
		<cfargument name="location" type="string" required="false" />
		<cfargument name="phone" type="string" required="false" />
		<cfargument name="fax" type="string" required="false" />
		<cfargument name="website" type="string" required="false" />
		<cfargument name="acceptUGJunior" type="numeric" required="false" />
		<cfargument name="acceptUGSenior" type="numeric" required="false" />
		<cfargument name="acceptFirstYear" type="numeric" required="false" />
		<cfargument name="acceptSecondYear" type="numeric" required="false" />
		<cfargument name="totalStudents" type="string" required="false" />
		<cfargument name="agencyPractice" type="string" required="false" />
		<cfargument name="servicesProvided" type="string" required="false" />
		<cfargument name="theoryBase" type="string" required="false" />
		<cfargument name="macroArea" type="string" required="false" />
		<cfargument name="clinicalArea" type="string" required="false" />
		<cfargument name="other" type="string" required="false" />
		<cfargument name="stipend" type="string" required="false" />
		<cfargument name="forProfit" type="boolean" required="false" />
		<cfargument name="clinical" type="boolean" required="false" />
		<cfargument name="foundation" type="boolean" required="false" />
		<cfargument name="macro" type="boolean" required="false" />
		<cfargument name="combined" type="boolean" required="false" />
		<cfargument name="health" type="boolean" required="false" />
		<cfargument name="metro" type="boolean" required="false" />
		<cfargument name="carLicense" type="boolean" required="false" />
		<cfargument name="foriegnLanguage" type="boolean" required="false" />
		<cfargument name="flexTime" type="boolean" required="false" />
		<cfargument name="handicapAccessible" type="boolean" required="false" />
		<cfargument name="faithBased" type="boolean" required="false" />
		<cfargument name="affiliationAgreement" type="boolean" required="false" />
		<cfargument name="fwsAgreement" type="boolean" required="false" />
		<cfargument name="agencyProfile" type="boolean" required="false" />
		<cfargument name="multipleSites" type="boolean" required="false" />
		<cfargument name="dateNinetyNine" type="date" required="false" />
		<cfargument name="datePhoneInformationReceived" type="date" required="false" />
		<cfargument name="dateOfAffiliation" type="date" required="false" />
		<cfargument name="dateOfVisit" type="date" required="false" />
		<cfargument name="backgroundDrugScreening" type="boolean" required="false" />
		<cfargument name="backgroundChildAbuse" type="boolean" required="false" />
		<cfargument name="backgroundImmunizationVerification" type="boolean" required="false" />
		<cfargument name="backgroundLiabilityVerification" type="boolean" required="false" />
		<cfargument name="backgroundSpecialApplication" type="boolean" required="false" />
		<cfargument name="backgroundReferenceLetters" type="boolean" required="false" />
		<cfargument name="backgroundFingerprinting" type="boolean" required="false" />
		<cfargument name="backgroundPoliceClearance" type="boolean" required="false" />
		<cfargument name="backgroundTBScreen" type="boolean" required="false" />
		<cfargument name="backgroundOther" type="string" required="false" />
		<cfargument name="backgroundRequiredDays" type="string" required="false" />
		<cfargument name="ageGroupAdults" type="boolean" required="false" />
		<cfargument name="ageGroupOlderAdults" type="boolean" required="false" />
		<cfargument name="ageGroupAdolescents" type="boolean" required="false" />
		<cfargument name="ageGroupFamilies" type="boolean" required="false" />
		<cfargument name="ageGroupChildren0to5" type="boolean" required="false" />
		<cfargument name="ageGroupChildren6to12" type="boolean" required="false" />
		<cfargument name="comments" type="string" required="false" />
		<cfargument name="needsLongForm" type="boolean" required="false" />
		<cfargument name="currentlyActive" type="boolean" required="false" />
		<cfargument name="doNotUse" type="boolean" required="false" />
		<cfargument name="agencyFlag" type="boolean" required="false" />
		<cfargument name="typeOfSetting" type="string" required="false" />
		<cfargument name="privateComments" type="string" required="false" />
		<cfargument name="leAdministration" type="numeric" required="false" />
		<cfargument name="leAdvocacy" type="numeric" required="false" />
		<cfargument name="leCaseManagement" type="numeric" required="false" />
		<cfargument name="leClinicalCaseManagement" type="numeric" required="false" />
		<cfargument name="leCommOrganization" type="numeric" required="false" />
		<cfargument name="leCrisisIntervention" type="numeric" required="false" />
		<cfargument name="leDischargePlanning" type="numeric" required="false" />
		<cfargument name="leFamilyTreatment" type="numeric" required="false" />
		<cfargument name="leGroupTreatment" type="numeric" required="false" />
		<cfargument name="leIndWithAdult" type="numeric" required="false" />
		<cfargument name="leIndWithChildren" type="numeric" required="false" />
		<cfargument name="leIndWithAdolescents" type="numeric" required="false" />
		<cfargument name="lePolicyAnalysis" type="numeric" required="false" />
		<cfargument name="leProgramPlanning" type="numeric" required="false" />
		<cfargument name="leProgramManagement" type="numeric" required="false" />
		<cfargument name="leResearch" type="numeric" required="false" />
		<cfargument name="leOther1" type="string" required="false" />
		<cfargument name="leOther2" type="string" required="false" />
		<cfargument name="tbCogBehavioral" type="boolean" required="false" />
		<cfargument name="tbCommTheory" type="boolean" required="false" />
		<cfargument name="tbCommDevelopment" type="boolean" required="false" />
		<cfargument name="tbContingency" type="boolean" required="false" />
		<cfargument name="tbCrisis" type="boolean" required="false" />
		<cfargument name="tbEcological" type="boolean" required="false" />
		<cfargument name="tbEmpowerment" type="boolean" required="false" />
		<cfargument name="tbExchange" type="boolean" required="false" />
		<cfargument name="tbFamilyTherapy" type="boolean" required="false" />
		<cfargument name="tbFeminist" type="boolean" required="false" />
		<cfargument name="tbPowerDependence" type="boolean" required="false" />
		<cfargument name="tbPsychodynamic" type="boolean" required="false" />
		<cfargument name="tbPsychosocial" type="boolean" required="false" />
		<cfargument name="tbSolution" type="boolean" required="false" />
		<cfargument name="tbSystems" type="boolean" required="false" />
		<cfargument name="tbTranspersonal" type="boolean" required="false" />
		<cfargument name="lobbying" type="boolean" required="false" />
		<cfargument name="nonProfit" type="boolean" required="false" />
		<cfargument name="agencyPublic" type="boolean" required="false" />
		<cfargument name="agencyPrivate" type="boolean" required="false" />
		<cfargument name="federal" type="boolean" required="false" />
		<cfargument name="stateCounty" type="boolean" required="false" />
		<cfargument name="communityBased" type="boolean" required="false" />
		<cfargument name="undergraduateJunior" type="boolean" required="false" />
		<cfargument name="ataother" type="string" required="false" />
		<cfargument name="adultsRank" type="numeric" required="false" />
		<cfargument name="olderAdultsRank" type="numeric" required="false" />
		<cfargument name="adolescentsRank" type="numeric" required="false" />
		<cfargument name="familiesRank" type="numeric" required="false" />
		<cfargument name="children0to5Rank" type="numeric" required="false" />
		<cfargument name="children6to12Rank" type="numeric" required="false" />
		<cfargument name="multiple" type="string" required="false" />
		<cfargument name="isPrivate" type="boolean" required="false" />
		<cfargument name="isPublic" type="boolean" required="false" />
		<cfargument name="completedDate" type="date" required="false" />
		<cfargument name="completedName" type="string" required="false" />
		<cfargument name="completedEmail" type="string" required="false" />
		<cfargument name="undergraduateSenior" type="boolean" required="false" />
		<cfargument name="transport" type="boolean" required="false" />
		<cfargument name="backgroundMedicalExam" type="boolean" required="false" />
		<cfargument name="tHomeVisits" type="boolean" required="false" />
		<cfargument name="tDriversLicense" type="boolean" required="false" />
		<cfargument name="tAutomobile" type="boolean" required="false" />
		<cfargument name="tAgencyVehicle" type="boolean" required="false" />
		<cfargument name="tOwnVehicle" type="boolean" required="false" />
		<cfargument name="tCovered" type="boolean" required="false" />
		<cfargument name="tOther" type="string" required="false" />
		<cfargument name="mpPolicyAnalysis" type="numeric" required="false" />
		<cfargument name="mpAdvocacy" type="numeric" required="false" />
		<cfargument name="mpCommOrganization" type="numeric" required="false" />
		<cfargument name="mpManagement" type="numeric" required="false" />
		<cfargument name="mpAdministration" type="numeric" required="false" />
		<cfargument name="mpPlanning" type="numeric" required="false" />
		<cfargument name="mpEvalResearch" type="numeric" required="false" />
		<cfargument name="comments2" type="string" required="false" />
		<cfargument name="notSureYet" type="boolean" required="false" />
		<cfargument name="flexHours" type="string" required="false" />
		<cfargument name="leIndWithAdultAdd" type="string" required="false" />
		<cfargument name="leIndWithChildrenAdd" type="string" required="false" />
		<cfargument name="leIndWithAdolescentsAdd" type="string" required="false" />
		<cfargument name="foreignLanguagePreferred" type="boolean" required="false" />
        <cfargument name="orderby" type="string" required="no" />
		
		<cfreturn variables.AgenciesGateway.getByAttributes(argumentCollection=arguments) />
	</cffunction>

	<cffunction name="saveAgencies" access="public" output="false" returntype="struct">
		<cfargument name="Agencies" type="Agencies" required="true" />

		<cfreturn variables.AgenciesDAO.save(Agencies) />
	</cffunction>

	<cffunction name="deleteAgencies" access="public" output="false" returntype="struct">
		<cfargument name="id" type="numeric" required="true" />
		
		<cfset var Agencies = createAgencies(argumentCollection=arguments) />
		<cfreturn variables.AgenciesDAO.delete(Agencies) />
	</cffunction>
</cfcomponent>
